import moment from 'moment'
import mixins from '../mixins/filterPrice'

export default {
  install(app) {
    // 混入
    app.mixin({
      methods: {
        ...mixins
      }
    })
    app.filter('pricefmt', price => {
      return '￥' + price + '元'
    })
    app.filter('timefmt', time => {
      return moment(time).format('YYYY-MM-DD HH:mm:ss')
    })
  }
}